package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.CertifyType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by oyhk on 16/7/13.
 */
@Entity
@Table(name = "certify_config")
@DynamicInsert
@DynamicUpdate
public class CertifyConfig extends IDEntityMall {

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(30) comment '认证类型( IMPACT(\"认证影响\"), PERSONAL(\"个人认证\"), COMPANY(\"企业认证\") )'")
    private CertifyType type = CertifyType.IMPACT;
    @Column(columnDefinition = "varchar(255) comment '名称'")
    private String name;
    @Column(columnDefinition = "text comment '编号'")
    private String code;
    @Column(columnDefinition = "bit comment '是否一定要'")
    private Boolean mustbe = false;
    @Column(columnDefinition = "bit comment '是否默认选中'")
    private Boolean selected = false;
    @Column(columnDefinition = "int comment '排序'")
    private Integer sort = 0;

    public CertifyType getType() {
        return type;
    }

    public void setType(CertifyType type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Boolean getMustbe() {
        return mustbe;
    }

    public void setMustbe(Boolean mustbe) {
        this.mustbe = mustbe;
    }

    public Boolean getSelected() {
        return selected;
    }

    public void setSelected(Boolean selected) {
        this.selected = selected;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public String toString() {
        return "CertifyConfig{" +
                "type=" + type +
                ", name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", mustbe=" + mustbe +
                ", selected=" + selected +
                ", sort=" + sort +
                '}';
    }
}
